import { type IFlowDevListModel, type IFlowDevListModelQuery, type IPressureModel, type IPressureModelQuery, type IRepairListModel, type IRepairListModelQuery, } from "./waterSupply.type";
import { useUserStore } from '@/store/userStore';
import { endHttp } from "../../axios"
import { type IPageResponse } from "../index.type";

export default {



  water: {
    devflowList(Query:Partial<IFlowDevListModelQuery>){
        return endHttp.get('/FlowVo/getPageList',Query) as Promise<IPageResponse<IFlowDevListModel>>
    },
   },
   flowDev:{
    list(Query: Partial<IFlowDevListModelQuery>){
        return endHttp.get('/DeviceFlowVo/ConditionalQuery',Query) as Promise<IPageResponse<IFlowDevListModel>>
    }

   },
   repair:{
    list(Query: Partial<IRepairListModelQuery>){
      return endHttp.get('/repair/getPageList', Query) as Promise<IPageResponse<IRepairListModel>>
    },
    update(Body: Partial<IRepairListModel>){
      return endHttp.put('/repair/update',Body) as Promise<IPageResponse<IRepairListModel>>
    }

   },
   pressure:{
    list(Query:Partial<IPressureModelQuery>){
        return endHttp.get('/repairPressureDevice/ConditionalQuery',Query) as Promise<IPageResponse<IPressureModel>>
    }
   },
   home: {
    energyDatabordLeakageAnalysis(Query:Partial<IPressureModelQuery>){
      const userStore = useUserStore();
      return endHttp.get(`energyDatabord/leakageAnalysis/${userStore.tenantId}`,Query) as Promise<IPageResponse<IPressureModel>>
    }
  }
   

}
